<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="d1">
        <input class="in1" type="button" value="in1按钮">
        <input class="in2" type="button" value="in2按钮">
    </div>
    <div class="d1" id="d2">
        <div id="d21">div d21</div>
        <span class="s1" id="ss1">span ss1</span>
    </div>

    <script>
        let div1s = document.getElementsByClassName("d1");
        console.log(div1s);

        let in1s = document.getElementsByClassName("in1")
        console.log(in1s)
        let in1 = in1s[0]
        console.log(in1)

        let span = document.getElementsByTagName("div")[1].getElementsByClassName("s1")[0]
        console.log(span)
    </script>
</body>
</html>